<template>
  <h3 style="color: red"><strong>{{title}}</strong></h3> <br>
  <div v-if="flag">flag={{flag?"true":"false"}} 显示</div> <br>

  <div v-if="num === 2">2</div>
  <div v-else-if="num === 3">3</div>
  <div v-else>4</div>

  <br>
  <div v-show="flag">v-show</div>
</template>

<script>
export default {
  name: "ifDemo",
  data(){
    return{
      title:"8.条件渲染",
      flag:true,
      num:3
    }
  }
}
</script>

<style scoped>

</style>